<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
    String callback = request.getParameter("callback");
	String isShow = request.getParameter("isShow") == null ? "" : request.getParameter("isShow");
    int flag =1;  	
%>
<html>
	<head>
		<title>查看开票详情</title>
		<script type="text/javascript" src="<%=contextPath %>/public/js/extend.js"></script>
		<style>
			.td1{
				padding-top:10px;
				padding-bottom:5px;
				font-size: 12px;
				background-color: #c0ebd7;
				width:20%;
			}
			.td2{
				padding:5px;
			}
		</style>
	<script type="text/javascript">
		var lastIndex;
		jQuery(document).ready(function() {
			jQuery('#ff').form({
				onLoadSuccess:function(){
				     jQuery('#person').val(jQuery('#creator').val());
				}
			});
		   jQuery('#ff').form('load','<%=contextPath%>/springMVC/xmFinance/getXMInvoiceById?id=<%=request.getParameter("id")%>');

	       $('#table').datagrid({
	    	    url:contextPath+"/springMVC/xmFinance/getXMInvoiceDetail?id=<%=request.getParameter("id")%>",
				rownumbers:true,
				fitColumns:true,
				nowrap:false,
				frozenColumns:[[
					//{field:'ck',checkbox:true},
				    {title:'分包商id',field:'worker_id',hidden:true}
				]],
				columns:[[
					{title:'分包商名称',field:'worker_company',width:250,align:'center'},
					{title:'负责人',field:'worker_person',width:150,align:'center'},
					{title:'开票额(元)',field:'out_invoice',width:200,align:'center'},
					{title:'税金(元)',field:'tax',width:100,align:'center'},
					{title:'备注',field:'remark',width:200,align:'center'}
					
				]],
				onBeforeLoad:function(){
					$(this).datagrid('rejectChanges');
				},
				onClickCell:function(rowIndex,field,value){
					if (lastIndex != rowIndex){
						$('#table').datagrid('endEdit', lastIndex);
						$('#table').datagrid('beginEdit', rowIndex);
						var ed = $('#table').datagrid('getEditor', {index:rowIndex,field:field});
						$(ed.target).select();
					}
					lastIndex = rowIndex;
				}
			});
			
		});

	</script>
	</head>
	<body>
		<div style="width: 97%;padding-left:10px">
		<form id="ff">
		  <input type="hidden" id="creator" name="creator"/>
			<table  style="border-collapse: collapse;" width="100%" border="1px" bordercolor="#0eb83a">
				<tr>
					<td align="right" class="td1" nowrap>项目编号：</td>
					<td class="td2" nowrap>
						<input  id="xm_code" name="xm_code" readOnly>
						<input type="hidden" id="xm_id" name="xm_id" readOnly>
						
					</td>
					<td align="right" class="td1" nowrap>项目名称：</td>
					<td class="td2" nowrap>
						<input  id="xm_name" name="xm_name" readOnly>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap>项目部门：</td>
					<td class="td2" nowrap>
						<input  id="dept_name" name="dept_name" readOnly>
						<input  type="hidden" id="dept_id" name="dept_id" readOnly>
					</td>
					<td align="right" class="td1" nowrap>经办人：</td>
					<td class="td2" nowrap>
						<input  id="person" name="person" readOnly>
					</td>
				</tr>
				<tr>
				<td align="right" class="td1" nowrap>对应客户：</td>
					<td class="td2" nowrap colspan="3">
						<input  id="customer" name="customer" >
					</td>
				<tr>
				<tr>
			        <td align="right" class="td1" nowrap>发票抬头：</td>
					<td class="td2" nowrap colspan="3" >
						<input  id="invoice_title" style="width:90%"  name="invoice_title">
					</td>
				<tr>
				<tr>	
				    <td align="right" class="td1" nowrap>预警时间：</td>
					<td class="td2" nowrap >
						<input  id="alarm_time" name="alarm_time" class="easyui-datebox"/>
					</td>		
			        <td align="right" class="td1" nowrap>开票总金额：</td>
					<td class="td2" nowrap>
						<input  id="account_receivable" name="account_receivable" class="easyui-numberbox" data-options="min:0,precision:2" value="0">
					</td>
				<tr>
				<tr>
					<td align="right" class="td1" nowrap>公司承担金额：</td>
					<td class="td2" nowrap>
						<input  id="company_out_invoice" name="company_out_invoice"  class="easyui-numberbox" data-options="min:0,precision:2" value="0">
					</td>
			
			        <td align="right" class="td1" nowrap>税金：</td>
					<td class="td2" nowrap>
						<input  id="company_tax" name="company_tax" class="easyui-numberbox" data-options="min:0,precision:2" value="0">
					</td>
		
				<tr>
					<td align="right" class="td1" nowrap>摘要：</td>
					<td class="td2" nowrap colspan='3'>
						<textarea  id="remark" name="remark" rows="6" style="width: 100%"></textarea>
					</td>
				</tr>
				<tr>
					<td colspan="4"  nowrap>
						<div id="table"></div>
					</td>
				</tr>
			</table>
			</form>
		</div>
		
		
	</body>
</html>